home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / managers / mc-3.2 / mc-3 / mc-3.2.1 / src / fs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-17  |  936 b   |  43 lines

  1. /* Include file to use opendir/closedir/readdir */
  2.  
  3. #ifndef __FS_H
  4. #define __FS_H
  5. #include <sys/types.h>
  6. #ifdef HAVE_UNISTD_H
  7. #   include <unistd.h>
  8. #endif
  9. #ifndef _OS_NT
  10. #include <sys/param.h>
  11. #endif
  12. #include <sys/stat.h>
  13.  
  14. #ifndef MAXPATHLEN
  15. #   define MC_MAXPATHLEN 1024
  16. #else
  17. #   define MC_MAXPATHLEN MAXPATHLEN
  18. #endif
  19.  
  20. /* unistd.h defines _POSIX_VERSION on POSIX.1 systems. */
  21. #if defined(HAVE_DIRENT_H) || defined(_POSIX_VERSION)
  22. #   include <dirent.h>
  23. #   define NLENGTH(dirent) (strlen ((dirent)->d_name))
  24. #   define DIRENT_LENGTH_COMPUTED 1
  25. #else
  26. #   define dirent direct
  27. #   define NLENGTH(dirent) ((dirent)->d_namlen)
  28.  
  29. #   ifdef HAVE_SYS_NDIR_H
  30. #       include <sys/ndir.h>
  31. #   endif /* HAVE_SYS_NDIR_H */
  32.  
  33. #   ifdef HAVE_SYS_DIR_H
  34. #       include <sys/dir.h>
  35. #   endif /* HAVE_SYS_DIR_H */
  36.  
  37. #   ifdef HAVE_NDIR_H
  38. #       include <ndir.h>
  39. #   endif /* HAVE_NDIR_H */
  40. #endif /* not (HAVE_DIRENT_H or _POSIX_VERSION) */
  41.  
  42. #endif
  43.